﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Business.IManager;
using Business.Manager;
using Entity;
using System.Data;

namespace OnlinePayment.OP
{
    public partial class Index : System.Web.UI.Page
    {
        AnnouncementManager announcementManager = new AnnouncementManager();
        public List<Announcement> annList = new List<Announcement>();
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                initAnnouncements();

            }

        }
        private void initAnnouncements()
        {
            DataSet ds = announcementManager.getAnnouncements();
            foreach (DataRow row in ds.Tables[0].Rows)
            {
                Announcement ann = new Announcement();
                ann.Id = Convert.ToInt32(row["Id"]);
                ann.Title = Convert.ToString(row["Title"]);
                annList.Add(ann);
            }

        }
    }



}